import { getCurrentInstance, onMounted, onUnmounted } from 'vue'

/**
 * @desc     一级面板默认emit handle hook
 * @author   邓清波
 * @date     2022/11/11
 * @param    void
 * @returns  void
 **/
function useDefaultEmits() {
    const { proxy } = getCurrentInstance();

    onMounted(() => {
        proxy.$el.addEventListener('click', () => proxy.$emit('handle', proxy.$props.routeName || proxy.$attrs.routeName))
    });
}

export default useDefaultEmits
